package 蓝桥杯;

/**
 * @description:
 * @author: qian
 * @createDate: 2021/11/17
 */
public class 回文数 {

    public static void main(String[] args) {


       for (int i = 1000; i <= 99999; i++) {

           String s = String.valueOf(i);
           int l = 0, r = s.length() - 1;
           while (l <= r) {
               if (l <= r && s.charAt(l) == s.charAt(r)) {
                   l++;
                   r--;
                   if (l == r / 2 && s.charAt(l) == s.charAt(r)) {
                       System.out.println(s);
                   }
               }

               if (s.charAt(l) != s.charAt(r)) break;

           }
       }

    }
}
